/*
 *  Licensed to PECATS under one or more contributor license agreements below:
 *  1. http://www.mozilla.org/MPL/MPL-1.1.html
 *  2. http://www.gnu.org/licenses/gpl-2.0.html
 *  3. http://www.gnu.org/licenses/lgpl-2.1.html
*/

/* **********************************************************
*  Class for Customer Information
*  Name: Customer.java
*  Author: www.pecats.com
*  Date: Sep 15, 2008
************************************************************/

package com.pecats.server.core;

import java.util.Set;
import java.util.HashSet;
import java.sql.Timestamp;

import com.pecats.server.core.Account;

/**
 * Used to store customer details
 */

public class Customer {

    public Long customerid;
    public String firstname;
    public String lastname;
    public String address;
    public String city;
    public String country;
    public int phone;
    public String email;
    public String company;
    public String password;
    public Timestamp time;

    private Set accounts = new HashSet();

    public Customer() 
    {
    }

    public Set getAccounts() {
       return accounts;
    }

    public void setAccounts(Set accounts) {
        this.accounts = accounts;
    }

    public void addToAccounts(Account account) 
    {
       this.getAccounts().add(account);
       account.getCustomers().add(this);
    }

    public void removeFromAccount(Account account) 
    {
        this.getAccounts().remove(account);
        account.getCustomers().remove(this);
    }

    public Long getCustomerid() {
        return customerid;
    }

    public void setCustomerid(Long customerid) {
        this.customerid = customerid;
    }

    public String getFirstname() {
        return firstname;
    }

    public void setFirstname(String firstname) {
        this.firstname = firstname;
    }

    public String getLastname() {
        return lastname;
    }

    public void setLastname(String lastname) {
        this.lastname = lastname;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getCity() {
        return city;
    }

    public void setCity(String city) {
        this.city = city;
    }

    public String getCountry() {
        return country;
    }

    public void setCountry(String country) {
        this.country = country;
    }

    public int getPhone() {
        return phone;
    }

    public void setPhone(int phone) {
        this.phone = phone;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getCompany() {
        return company;
    }

    public void setCompany(String company) {
        this.company = company;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public Timestamp getTime() {
        return time;
    }

    public void setTime(Timestamp time) {
        this.time = time;
    }

}